package chpt08;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class FileCopyByByte2 {

	public static void main(String[] args){
		try (FileInputStream in = new FileInputStream("test.txt");
			FileOutputStream out = new FileOutputStream("test.bak")){
			int c;
			while((c=in.read())!=-1)
				out.write(c);
		}catch(IOException e) {
			e.printStackTrace();
		}		
	}
}

